
 begintownscript;

 variables;

 int i,j,k,r1,choice;

 body;

 beginstate INIT_STATE;

	set_name(6,"Havelock");
	force_view_center(8,15);
	relocate_character(0,8,15);
	relocate_character(1,7,15);
	relocate_character(2,6,15);
	relocate_character(3,5,15);

	if (get_flag(10,2) == 0) {
		force_instant_terrain_redraw();
		message_dialog("The hut in front of you, though fairly large, is a wreck. The walls are cracked and rotten. It is hard to believe that anyone has lived there for decades.","");
		set_flag(10,2,1);
}


break;

 beginstate START_STATE;

	if ((party_can_see_loc(16,16) && get_flag(10,3) == 0)) {
		message_dialog("You were wrong, the hut is inhabited after all. An old man, dressed in the robes of a wizard, has made the hut into his laboratory. You look around, layers of dust cover the room. The old man must have been too busy to clean up.","");
		set_flag(10,3,1);
}

break;

 beginstate EXIT_STATE;

break;

 beginstate 10;
	reset_dialog();
	add_dialog_str(0,"You find the trapdoor exactly where the wizard said it would be. You could possibly face something dangerous down there, nonetheless you need to climb down sooner or later.",0);
	add_dialog_choice(0,"Climb down.");
	add_dialog_choice(1,"Leave.");
	choice = run_dialog(1);

	if (choice == 1) 
		move_to_new_town(14,24,24);

break;

 beginstate 11;
	if (get_flag(10,4) == 0) {
		message_dialog("The bedroom is also covered with several layers of dust, even more so than the rest of the hut. It looks as if no-one has even opened the door to this room for years. Surely the old man needs to sleep, but he isn't doing it here.","You also notice rotten food on the desk. Judging by the state of decomposing, the food has been lying on the desk for years.");
		set_flag(10,4,1);
}
 break;

 beginstate 12;
	message_dialog("You peek inside the crate. You've never seen so many various items jammed in such a small container. You see different potions, various herbs, chunks of metal, and something rotten, that stinks up the entire room when you open the crate.","You wonder, does the wizard plan on using all this stuff? You decide not to take anything, though.");
 break;